package com.wyj.code.api;

import com.wyj.code.entity.dto.CodeDTO;
import com.wyj.response.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * TODO: 验证码接口
 *
 * @author wuyijie
 * @date 2022/2/9 23:39
 */
@Api(value = "ICodeApi", tags = "验证码API")
public interface ICodeApi {

    /**
     * TODO: 根据唯一标识创建code
     *
     * @param identification 唯一标识
     * @return com.wyj.response.ApiResult<com.wyj.code.entity.dto.CodeDTO>
     * @author wuyijie
     * @date 2022/2/13 12:42 AM
     */
    @ApiOperation(value = "createWithIdentification", notes = "根据唯一标识创建code")
    @RequestMapping(value = "/createWithIdentification/{identification}", method = RequestMethod.GET)
    ApiResult<CodeDTO> createWithIdentification(@PathVariable(value = "identification") String identification);

    /**
     * TODO: 根据验证码、标识，查询验证码信息
     *
     * @param code           验证码
     * @param identification 唯一标识
     * @return com.wyj.response.ApiResult<com.wyj.code.entity.dto.CodeDTO>
     * @author wuyijie
     * @date 2022/2/13 12:42 AM
     */
    @ApiOperation(value = "code", notes = "根据验证码、标识，查询验证码信息")
    @RequestMapping(value = "/{code}", method = RequestMethod.GET)
    ApiResult<CodeDTO> code(@PathVariable(value = "code") String code, @RequestParam(value = "identification") String identification);

}
